﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.ComponentModel;

namespace Kokomo.Mirror.CliMetadata.Tables
{
	public class ExportedTypeRow : IMetadataRow
	{
		public TypeAttributes Flags {get; set;}
		public int TypeDefId {get; set;}
		public StringRef TypeName {get; set;}
		public StringRef TypeNamespace {get; set;}
		[CodedIndex(CodedIndexType.Implementation)]
		public CodedIndex Implementation {get; set;}

		public override string ToString(MetadataContainer container)
		{
			string ns = container.GetString(this.TypeNamespace);
			string name = container.GetString(this.TypeName);

			if (ns == null) return name;
			else return string.Format("{0}.{1}", ns, name);
		}
	}
}
